<?php

include('../config.php');

$id = $_GET['id'];
$name = $_GET['name'];
$price = $_GET['price'];
$num = $_GET['num'];

$sql = "update shop set name='$name',price=$price,num=$num where id=$id";

$res = mysql_query($sql);

if ($res) {
    echo json_encode(array(
        "code" => 200,
        "msg" => "更新成功"
    ));
} else {
    echo json_encode(array(
        "code" => 500,
        "msg" => "网络错误，请重试"
    ));
}

?>